package com.yanqu.road.entity.activity.washe.eliminate;

import com.yanqu.road.entity.enums.washe.eWasheOperateType;

import java.util.ArrayList;
import java.util.List;

public class WasheOperateResult {

    private int ret = 0;
    private eWasheOperateType type;
    private int skillId = 0;            // 移动0，卡片技能、盘面技能时为对应ID
    private int turn = 1;               // 轮到谁了

    // 过程表现
    private List<WasheOperateShow> showList = new ArrayList<>();

    // 生成炸弹加步数状态
    private int bombAddStepStatus = -1; // 默认-1无法加步数，0未加步数，1已加步数
    private int scene07AddMp = 0;       // 百宝箱加蓝数量

    // 最终盘面
    private WasheGameData finalData = null;

    // ===========================================================

    public void addEffect(WasheOperateEffect effect) {
        if (showList.isEmpty() || !showList.get(showList.size() - 1).getRoundResultList().isEmpty()) {
            showList.add(new WasheOperateShow());
        }
        showList.get(showList.size() - 1).addEffect(effect);
    }

    public void addRoundResult(WasheOperateRoundResult roundResult) {
        if (showList.isEmpty()) {
            showList.add(new WasheOperateShow());
        }
        showList.get(showList.size() - 1).addRoundResult(roundResult);
    }

    public void addShow(WasheOperateShow show) {
        this.showList.add(show);
    }

    public WasheOperateResult(eWasheOperateType type, boolean stepMax, int turn) {
        this.type = type;
        this.turn = turn;
        if (type == eWasheOperateType.Move ||
                !stepMax && type == eWasheOperateType.UseSkill) {
            this.bombAddStepStatus = 0;
        }
    }

    public static WasheOperateResult newSceneRefreshResult(int turn) {
        WasheOperateResult result = new WasheOperateResult(eWasheOperateType.UseSkill, true, turn);
        result.setSkillId(-1);
        return result;
    }

    // ===========================================================

    public int getBombAddStepStatus() {
        return bombAddStepStatus;
    }

    public void setBombAddStepStatus(int bombAddStepStatus) {
        this.bombAddStepStatus = bombAddStepStatus;
    }

    public int getRet() {
        return ret;
    }

    public void setRet(int ret) {
        this.ret = ret;
    }

    public eWasheOperateType getType() {
        return type;
    }

    public void setType(eWasheOperateType type) {
        this.type = type;
    }

    public List<WasheOperateShow> getShowList() {
        return showList;
    }

    public void setShowList(List<WasheOperateShow> showList) {
        this.showList = showList;
    }

    public WasheGameData getFinalData() {
        return finalData;
    }

    public void setFinalData(WasheGameData finalData) {
        this.finalData = finalData;
    }

    public int getSkillId() {
        return skillId;
    }

    public void setSkillId(int skillId) {
        this.skillId = skillId;
    }

    public int getTurn() {
        return turn;
    }

    public void setTurn(int turn) {
        this.turn = turn;
    }

    public int getScene07AddMp() {
        return scene07AddMp;
    }

    public void setScene07AddMp(int scene07AddMp) {
        this.scene07AddMp = scene07AddMp;
    }
}
